package io.gitee.wminyu.day03.Homework;

import org.junit.Test;

public class test {
    @Test
    public void test(){
        Rectangle rectangle = new Rectangle();
        rectangle.setHeight(40);
        rectangle.setWidth(4);
        System.out.println(rectangle.toString());

        Rectangle rectangle1 = new Rectangle(3.8,35.49);
        System.out.println(rectangle1.toString());

    }
    @Test
    public void test2(){
        Teacher teacher = new Teacher();
        teacher.setName("黄超杰");
        teacher.setAge("34");
        teacher.setContent("俄罗斯方块游戏");
        teacher.eat();
        teacher.takeClass();
    }
    @Test
    public void test3(){
        Student student = new Student("xx","16","面向对象的知识");
        student.eat();
        student.study();

    }
    @Test
    public void test4(){
        Phone phone = new Phone();
        phone.setBrand("小米");
        phone.setPrice("998");
        phone.call();
        phone.sendMessage();
        phone.playGame();
    }

    @Test
    public void test5(){
        Book1 book1 = new Book1();
        Book2 book2 = new Book2();
        Book3 book3 = new Book3();
        double max = book1.getPrice();
        if (book2.getPrice()>max){
            max = book2.getPrice();
            System.out.println(book2.toString());
        }
        else if (book3.getPrice()>max){
            max = book3.getPrice();
            System.out.println(book3.toString());
        }
        else {
            System.out.println(book1.toString());
        }
    }
}
